<?php

  //Overlay image ontop of another
class FP_Image_Watermark extends FP_Image
{
  public function __construct($pBaseFile, $pOverlayFile, $pDX, $pDY, $pSX, $pSY, $pSWidth, $pSHeight, $pAlphaBlending=true, $pDestination=null){

    $overlay = $this->create($pOverlayFile);
    $base = $this->create($pBaseFile);

    imagealphablending($overlay, $pAlphaBlending);

    imagecopy($base, $overlay, $pDX, $pDY, $pSX, $pSY, $pSWidth, $pSHeight);

    if ($pDestination)
      $this->save($pDestination);
  }
}

?>